package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DisableMedicineMapper;
import com.ruoyi.system.domain.DisableMedicine;
import com.ruoyi.system.service.IDisableMedicineService;

/**
 * 禁用农药Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-23
 */
@Service
public class DisableMedicineServiceImpl implements IDisableMedicineService 
{
    @Autowired
    private DisableMedicineMapper disableMedicineMapper;

    /**
     * 查询禁用农药
     * 
     * @param id 禁用农药主键
     * @return 禁用农药
     */
    @Override
    public DisableMedicine selectDisableMedicineById(Long id)
    {
        return disableMedicineMapper.selectDisableMedicineById(id);
    }

    /**
     * 查询禁用农药列表
     * 
     * @param disableMedicine 禁用农药
     * @return 禁用农药
     */
    @Override
    public List<DisableMedicine> selectDisableMedicineList(DisableMedicine disableMedicine)
    {
        return disableMedicineMapper.selectDisableMedicineList(disableMedicine);
    }

    /**
     * 新增禁用农药
     * 
     * @param disableMedicine 禁用农药
     * @return 结果
     */
    @Override
    public int insertDisableMedicine(DisableMedicine disableMedicine)
    {
        disableMedicine.setCreateTime(DateUtils.getNowDate());
        return disableMedicineMapper.insertDisableMedicine(disableMedicine);
    }

    /**
     * 修改禁用农药
     * 
     * @param disableMedicine 禁用农药
     * @return 结果
     */
    @Override
    public int updateDisableMedicine(DisableMedicine disableMedicine)
    {
        disableMedicine.setUpdateTime(DateUtils.getNowDate());
        return disableMedicineMapper.updateDisableMedicine(disableMedicine);
    }

    /**
     * 批量删除禁用农药
     * 
     * @param ids 需要删除的禁用农药主键
     * @return 结果
     */
    @Override
    public int deleteDisableMedicineByIds(Long[] ids)
    {
        return disableMedicineMapper.deleteDisableMedicineByIds(ids);
    }

    /**
     * 删除禁用农药信息
     * 
     * @param id 禁用农药主键
     * @return 结果
     */
    @Override
    public int deleteDisableMedicineById(Long id)
    {
        return disableMedicineMapper.deleteDisableMedicineById(id);
    }
}
